package com.xuzz.study.io.netty.http;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;

public class TestServerInitilizer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        //像管道加入处理器
        socketChannel.pipeline().addLast("MyHttpServerCodec",new HttpServerCodec());
        socketChannel.pipeline().addLast("MyTestHttpHandler",new TestHttpHandler());
    }
}
